<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>

<p:ajaxStatus onstart="statusDialog.show();"
	onsuccess="statusDialog.hide();" />

<p:dialog modal="true" widgetVar="statusDialog" header="buscando..."
	draggable="false" closable="false">
	<p:graphicImage value="resources/images/ajaxloadingbar.gif" />
</p:dialog>

<h:body>
	<h1>Logos: Façam suas perguntas!</h1>

	<h:form>
		<h:inputText value="#{logosUserViewMB.question}" tabindex="0" />
		<p:commandButton icon="ui-icon-search" ajax="true" global="true"
			actionListener="#{logosUserViewMB.doSearch()}"
			action="search"
			update=":resultContainer">
		</p:commandButton>
	</h:form>

	<p:outputPanel id="resultContainer" rendered="false">
		<h:form prependId="false">
			<p:pieChart id="pieChart" lazy="true"
				value="#{logosUserViewMB.questionResultView.pieModel}"
				legendPosition="w" title="Resposta(s)"
				style="width:400px;height:300px;border:none">
				<p:ajax event="itemSelect" listener="#{logosUserViewMB.itemSelect}"  global="true"/>
			</p:pieChart>
		</h:form>			
	</p:outputPanel>

</h:body>
</html>